return {
  {
    "mason-org/mason.nvim",
    opts = {
      ensure_installed = {
        "lua-language-server"
      },
      install_root_dir = vim.fn.stdpath "data" .. "/mason",
      registries = {
        "github:mason-org/mason-registry",
      },
      log_level = vim.log.levels.INFO,
      ui = {
        border = "rounded",
        icons = {
          package_installed = "✓",
          package_pending = "➜",
          package_uninstalled = "✗",
        },
      },
      keymaps = {
        -- Keymap to expand a package
        toggle_package_expand = "<CR>",
        -- Keymap to install the package under the current cursor position
        install_package = "i",
        -- Keymap to reinstall/update the package under the current cursor position
        update_package = "u",
        -- Keymap to check for new version for the package under the current cursor position
        check_package_version = "c",
        -- Keymap to update all installed packages
        update_all_packages = "U",
        -- Keymap to check which installed packages are outdated
        check_outdated_packages = "C",
        -- Keymap to uninstall a package
        uninstall_package = "X",
        -- Keymap to cancel a package installation
        cancel_installation = "<C-c>",
        -- Keymap to apply language filter
        apply_language_filter = "<C-f>",
        -- Keymap to toggle viewing package installation log
        toggle_package_install_log = "<CR>",
        -- Keymap to toggle the help view
        toggle_help = "g?",
      },
    },
    config = function(_, opts)
      require("mason").setup(opts)
      local mr = require("mason-registry")
      local function ensure_installed()
        for _, tool in ipairs(opts.ensure_installed) do
          local p = mr.get_package(tool)
          if not p:is_installed() then
            p:install()
          end
        end
      end
      if mr.refresh then
        mr.refresh(ensure_installed)
      else
        ensure_installed()
      end
    end
  },
  {
    "neovim/nvim-lspconfig",
    dependencies = {
      "saghen/blink.cmp",
      "mason-org/mason.nvim",
    },
    config = function()
      local sign_define_diagnstic = function(err, warn, hint, info)
        local x = vim.diagnostic.severity
        vim.diagnostic.config {
          virtual_text = {
            -- source = "always",  -- Or "if_many"
            prefix = "■-> ", -- Could be '●', '■', '▎', 'x'
          },
          virtual_lines = false, --  多行诊断信息, 可以不设置, 使用插件trouble.nvim 在 buffer 中显示更加友好
          signs = {
            text = {
              [x.ERROR] = err or "✘",
              [x.WARN] = warn or "",
              [x.HINT] = hint or "⚑",
              [x.INFO] = info or "",
            },
          },
          underline = true,
          severity_sort = true,
          update_in_insert = true,
          float = {
            source = true, -- Or "if_many"
            border = "rounded",
          },
        }
      end
      local icon = {
        ERROR = "", -- "✘",
        WARN = "", --"",
        HINT = "⚑", -- '󰌵',
        INFO = "", -- "", -- '󰋇',
      }

      sign_define_diagnstic(icon.ERROR, icon.WARN, icon.HINT, icon.INFO)

      local capabilities = require("blink.cmp").get_lsp_capabilities()
      local lspconfig = require("lspconfig")
      vim.lsp.config("lua_ls", {
        cmd = { "lua-language-server" },
        filetypes = { "lua" },
        capabilities = capabilities,
        -- settings. See `:help lsp-quickstart`
        settings = {
          Lua = {
            diagnostics = {
              -- lua 中全局的 vim 变量不报警告
              globals = { "vim" },
            },
          },
        },
      })
      vim.lsp.enable("lua_ls")

      vim.api.nvim_create_autocmd("LspAttach", {
        group = vim.api.nvim_create_augroup("UserLspConfig", {}),
        callback = function(ev)
          -- 获取服务信息
          local client = vim.lsp.get_client_by_id(ev.data.client_id)
          if client == nil then
            return
          end

          vim.keymap.set("n", "K", vim.lsp.buf.hover)
          vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, {
            buffer = ev.buf,
            desc = "[LSP] Rename"
          })
          vim.keymap.set("n", "<leader>oc", vim.diagnostic.open_float, {
            buffer = ev.buf,
            desc = "[LSP] Show diagnostic"
          })
        end
      })
    end
  },
}
